<style type="text/css">
	body {
		margin: 0px;
		padding: 0px;
	}

	div {
		height: 180px;
		width: 300px;
	}

	ul {
		margin: 0px;
		padding: 0px;
	}

	li {
/*		margin-left: 5px;*/
		margin-bottom: 5px;
		padding-left: 5px;
		padding-top: 4px;
		height: 25px;
		cursor: pointer;
		border: 1px #83A90D solid;
		list-style-type: none;
		background-color: #BFDF90;
		font-size:	15px;
		font-family: '微软雅黑', '宋体';
/*		color: #FFFFFF;*/
	}


	.tip {
		margin-left: 15px;
		margin-right: 15px;
		float: right;
	}
</style>

<div>
<ul>
	<li url="/{uid}/atme">
		<span>@我的</span>
		<span id="atme" class="tip">0</span>
	</li>
	<li url="/{uid}/follows">
		<span>关注</span>
		<span id="attention" class="tip">0</span>
	</li>
	<li url="/{uid}/comment">
		<span>回复我的</span>
		<span id="comment" class="tip">0</span>
	</li>
	<li url="/home">
		<span>feed</span>
		<span id="feed" class="tip">0</span>
	</li>
	<li url="/{uid}/msg">
		<span>私信</span>
		<span id="message" class="tip">0</span>
	</li>
</ul>
</div>

	<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
	<script type="text/javascript" src="jquery.cookie.js"></script>

	<script type="text/javascript">
$(document).ready(init);

var uid = 0;

function dealCookie(cookie) {
	uid = cookie.value;
}

function init() {
	var backgroundData = chrome.extension.getBackgroundPage();

	chrome.cookies.get({url:'http://qiyi.com', name:'T00004'}, dealCookie);

	$('#atme').text(backgroundData.atmeNum);
	$('#attention').text(backgroundData.attentionNum);
	$('#comment').text(backgroundData.commentNum);
	$('#feed').text(backgroundData.feedNum);
	$('#message').text(backgroundData.messageNum);

	$('ul > li').hover(
		function() {
			$(this).css('background-color', '#E3FAD1');
		},

		function() {
			$(this).css('background-color', '#BFDF90');
		}
	);

	$('ul > li').click(function() {
		var url = $(this).attr('url');

		url = 'http://t.qiyi.com' + url.replace(/{uid}/ig, uid);

//		$(this).find(".tip").text(0);

		var id = $(this).find(".tip").attr('id');

		backgroundData[id + 'Num'] = 0;

var data = {
	code : 'A00000',
	data : {
		atme : backgroundData.atmeNum,
		comment : backgroundData.commentNum,
		feed : backgroundData.feedNum,
		attention : backgroundData.attentionNum,
		msg : backgroundData.messageNum
	}
}
		chrome.extension.getBackgroundPage().newMessageCallback(data);

		window.open(url);

	});
}



	</script>


